﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EFong.Data
{
    public static class EFongEntitiesManager
    {
        private static string _connectionString = @"metadata=res://*/EFongModel.csdl|res://*/EFongModel.ssdl|res://*/EFongModel.msl;provider=System.Data.SqlClient;provider connection string='Data Source=Anson-Notebook;Initial Catalog=EFong;Persist Security Info=True;User ID=sa;Password=123456;MultipleActiveResultSets=True'";

        public static EFongEntities GetInstance() 
        {
            return new EFongEntities(_connectionString);
        }

        public static void SetConntectionString(string connectionString) 
        {
            _connectionString = connectionString;
        }

        public static void Test(string connectionString)
        {
            try
            {
                new EFongEntities(connectionString);
            }
            catch (Exception)
            {
                throw;
            }
        }
    }
}
